-
Notifications
You must be signed in to change notification settings - Fork 0
feat(mbe): api to sign and send a txrequest #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1bf290e to
505c288
Compare
505c288 to
3c11b17
Compare
|
@claude review the PR |
|
@claude review this pr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a new endpoint to sign and send MPC transaction requests and integrates it into the API spec, router, handler, tests, and OpenAPI JSON.
- Introduces
handleSignAndSendTxRequesthandler and wires it intoMasterApiSpecand router - Defines request/response types (
SignMpcRequest/SignMpcResponse) and adds tests for ECDSA and EdDSA flows - Updates
masterBitgoExpress.jsonto include the new/txrequest/{txRequestId}/signAndSendpath
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/api/master/routers/masterApiSpec.ts | Added new route spec and registration for signAndSend |
| src/api/master/handlers/handleSignAndSendTxRequest.ts | Implemented MPC sign-and-send handler logic |
| src/tests/api/master/signAndSendTxRequest.test.ts | Added tests covering successful and pending flows |
| masterBitgoExpress.json | Updated OpenAPI spec with new path (and removed passphrase parameter) |
Comments suppressed due to low confidence (5)
masterBitgoExpress.json:258
- The
walletPassphraseproperty was removed from the consolidate request schema here but likely unintentionally. Reintroduce or confirm removal if intended.
},
src/api/master/routers/masterApiSpec.ts:228
- Using
t.anyfor the 200 response is too permissive. Define a specific codec that matches the expected response properties (e.g.,txid,tx, optionalpendingApproval, etc.).
200: t.any,
masterBitgoExpress.json:634
- The OpenAPI spec for the signAndSend endpoint has an empty schema for the 200 response—please specify the returned object structure to aid consumers.
"schema": {}
src/api/master/routers/masterApiSpec.ts:222
- [nitpick]
SignMpcRequestis generic; consider renaming toSignAndSendTxRequestBodyfor clarity and consistency with the endpoint.
const SignMpcRequest = {
src/tests/api/master/signAndSendTxRequest.test.ts:22
- [nitpick] Tests cover successful and pending cases but lack negative scenarios (e.g., wallet not found, wrong wallet type, or mismatched
commonKeychain). Consider adding those to improve coverage.
describe('POST /api/:coin/wallet/:walletId/txrequest/:txRequestId/signAndSend', () => {
3c11b17 to
9fe64d7
Compare
| } | ||
|
|
||
| if (wallet.type() !== 'cold' || wallet.subType() !== 'onPrem') { | ||
| throw new Error('Wallet is not an on-prem wallet'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Advanced Wallet
No description provided.